package net.kunyv.entity;

import net.kunyv.util.ColumnUtil;

public class EntityColumn
{
    private boolean isMybatis;
    private String entityColumnMethodNam;
    private boolean key = false;
    private String columnNam;
    private String columnTyp;
    private String entityColumnNam;
    private String entityColumnTyp;
    private String entityColumnComment;
    private int precision;
    private int scale = 0;




    private boolean required = false;




    private String uiTyp;




    private boolean search;




    private String hiddenL = "false";




    private String selectName;




    private String op;



    private String formhidden = "false";





    private String escape = "false";


    private String databaseName;

    private boolean noCamel = false;


    public String getColumnNam() { return this.columnNam; }



    public void setColumnNam(String columnNam) {
        this.columnNam = columnNam;
        this.entityColumnNam = ColumnUtil.genAtrributeName(this.columnNam, this.isMybatis);
        if (columnNam.indexOf("_") == 1) {
            this.noCamel = true;
        }
        this.entityColumnMethodNam = ColumnUtil.genClassAndMethodName(this.columnNam, false, this.isMybatis);
    }



    public String getEntityColumnNam() { return this.entityColumnNam; }




    public void setEntityColumnNam(String entityColumnNam) { this.entityColumnNam = entityColumnNam; }




    public String getEntityColumnTyp() { return this.entityColumnTyp; }




    public void setEntityColumnTyp(String entityColumnTyp) { this.entityColumnTyp = entityColumnTyp; }




    public String getEntityColumnComment() { return this.entityColumnComment; }




    public void setEntityColumnComment(String entityColumnComment) { this.entityColumnComment = entityColumnComment; }




    public String getColumnTyp() { return this.columnTyp; }



    public void setColumnTyp(String columnTyp) {
        this.entityColumnTyp = ColumnUtil.sqlType2JavaType(columnTyp);
        if (this.isMybatis) {
            this.columnTyp = ColumnUtil.sqlType2sqlType4Mybatis(columnTyp, this.databaseName);
        } else {
            this.columnTyp = ColumnUtil.sqlType2sqlType4Mybatis(columnTyp, this.databaseName);
        }
    }




    public boolean getKey() { return this.key; }




    public void setKey(boolean key) { this.key = key; }




    public String getEntityColumnMethodNam() { return this.entityColumnMethodNam; }




    public void setEntityColumnMethodNam(String entityColumnMethodNam) { this.entityColumnMethodNam = entityColumnMethodNam; }




    public int getPrecision() { return this.precision; }




    public void setPrecision(int precision) { this.precision = precision; }




    public int getScale() { return this.scale; }




    public void setScale(int scale) { this.scale = scale; }




    public boolean getRequired() { return this.required; }




    public void setRequired(boolean required) { this.required = required; }




    public String getUiTyp() { return this.uiTyp; }




    public void setUiTyp(String uiTyp) { this.uiTyp = uiTyp; }




    public boolean isSearch() { return this.search; }




    public void setSearch(boolean search) { this.search = search; }




    public boolean isMybatis() { return this.isMybatis; }




    public void setMybatis(boolean isMybatis) { this.isMybatis = isMybatis; }




    public String getSelectName() { return this.selectName; }




    public void setSelectName(String selectName) { this.selectName = selectName; }




    public String getHiddenL() { return this.hiddenL; }




    public void setHiddenL(String hiddenL) { this.hiddenL = hiddenL; }




    public String getOp() { return this.op; }




    public void setOp(String op) { this.op = op; }




    public String getFormhidden() { return this.formhidden; }




    public void setFormhidden(String formhidden) { this.formhidden = formhidden; }




    public String getEscape() { return this.escape; }




    public void setEscape(String escape) { this.escape = escape; }




    public String getDatabaseName() { return this.databaseName; }




    public void setDatabaseName(String databaseName) { this.databaseName = databaseName; }




    public boolean getNoCamel() { return this.noCamel; }




    public void setNoCamel(boolean noCamel) { this.noCamel = noCamel; }
}
